Answer:

The program will print:

The result is   5

Saving a Result

Look at the new program again:

' Program with a variable
'
LET VALUE = 2 + 3
PRINT "The result is", VALUE
END

The first statement does several things:

  1. Memory is reserved for the variable VALUE
  2. A number is calculated: 2 + 3 = 5
  3. The number 5 is stored in the variable.

The LET statement can be used with a variable to save the result of arithmetic. The value saved in the variable will stay there until another statement changes it, or until the program stops running.

QUESTION 4:

What do you think the following program will write to the monitor?

' Saving a result in a variable
'
LET SUM = 1 + 2 + 3
PRINT "The sum is", SUM
END